# coding=utf-8
# utils/num_to_chinese.py

def num_to_chinese(num):
    if not (0 <= num <= 99):
        raise ValueError("请输入 1 到 99 之间的数字")

    chinese_digits = ["零", "一", "二", "三", "四", "五", "六", "七", "八", "九"]
    chinese_units = ["", "十"]

    if num < 10:
        return chinese_digits[num]

    tens = num // 10
    ones = num % 10

    if ones == 0:
        return chinese_digits[tens] + chinese_units[1]

    if tens == 1:
        return chinese_units[1] + chinese_digits[ones]

    return chinese_digits[tens] + chinese_units[1] + chinese_digits[ones]